package com.jt.pojo;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author 张琪
 * @date 2020/11/24
 * @describe 使用该方法可以从配置文件中读取信息到对象中
 */
@Component
@PropertySource(value = {"classpath:/properties/cat.properties"})
@ConfigurationProperties(prefix = "cat")
@Getter
@Setter
@ToString
public class Cat {
    private Integer id;
    private String username;
}
